<extend name="public@base5"/>

<block name="main">
    <script type="text/html" id="photos-item-tpl">
        <li id="saved-image{id}">
            <input id="photo-{id}" type="hidden" name="item_images[]" value="{filepath}">
            <input class="form-control" id="photo-{id}-name" type="text" name="image_names[]" value="{name}"
                   style="width: 200px;" title="图片名称">
            <img id="photo-{id}-preview" src="{url}" style="height:34px;width: 44px;"
                 onclick="imagePreviewDialog(this.src);">
            <a class="btn btn-default" href="javascript:uploadOneImage('图片上传','#photo-{id}');"><i class="fa fa-upload fa-fw"></i></a>
            <a class="btn btn-danger" href="javascript:(function(){$('#saved-image{id}').remove();})();"><i class="fa fa-trash fa-fw"></i></a>
            <a class="btn btn-success" href="javascript:(function(){$('#saved-image{id}').before($('#saved-image{id}').next());})();"><i class="fa fa-arrow-down fa-fw"></i></a>
        </li>
    </script>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link" href="{:url('Store/booth',['bid'=>$booth_type])}">展位列表</a>
            </li>
            <li class="nav-item">
                <a class="nav-link active" href="#">添加展位</a>
            </li>
        </ul>
        <form method="post" class="js-ajax-form margin-top-20" action="admin/digital/add">
            <input type="hidden" name="booth_type" value="{$booth_type}"/>
            <input type="hidden" name="check_count" value="{$check_count}"/>
            <div class="row mb-3">
                <label for="input-item_name" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>展位名称</label>
                <div class="col-md-2 col-sm-4">
                    <input type="text" class="form-control" id="input-item_name" name="booth_name">
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-item_type" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>按钮名称</label>
                <div class="col-md-2 col-sm-2">
                    <input type="text" class="form-control" id="input-item_type" name="button_name" placeholder="按钮名称" >
                </div>

            </div>
            <div class="row mb-3">
                <label for="input-booth_type" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>展位类型</label>
                <div class="col-md-2 col-sm-2">
                    <input type="text" class="form-control" id="input-booth_type" name="booth_class" placeholder="展位类型" >
                </div>

            </div>  

            <div class="row mb-3">
                <div class="offset-md-2 col-sm-10">
                    <button type="submit" class="btn btn-primary js-ajax-submit">
                        <i class="fa fa-save fa-fw"></i> {:lang('ADD')}
                    </button>
                </div>
            </div>
        </form>

    </div>
</block>

<block name="scripts">
    <script src="__STATIC__/js/mall.js"></script>
</block>